<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <title>input event test</title>
</head>
<body>
<h1>see console please</h1>

value ： <input id="test"/>

<button id="action">random set value</button>

<button id="interval">interval set value</button>

<script src="/kissy/build/seed-debug.js"></script>
<script src="/kissy/src/log.js"></script>
<script src="/kissy/src/package.js"></script>
<script>
    (function(){
        KISSY.use("dom,event/dom,node", function (S, Dom, Event, Node) {
            var test = Node.one("#test");
            var doc = Node.one(document);



            test.on("input", function (e) {
                log("newVal : " + e.target.value);
            });

            doc.on("input", function (e) {
                log("doc newVal: " + e.target.value);
                log("doc target: " + e.target.id);
            });

            var action = Node.one("#action");
            action.on("click", function () {
                test.val(+new Date());
            });

            Node.one("#interval").on("click", function () {
                setInterval(function(){
                    test.val(+new Date());
                },1000);
            });
            alert('ok')
        });
    })();
</script>
</body>
</html>